﻿/*
 ***********************************
 时间：2017
 代码：WangSir
 脚本作用：
 ************************************
 */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using I2.Loc;

/// <summary> </summary>
public class MySetLanguage :MonoBehaviour
{
    private SetLanguage setLanguage;
    public static MySetLanguage instance;


    private void Start()
    {
        setLanguage = transform.GetComponent<SetLanguage>();
        if (MySetLanguage.GetLanguage().StartsWith("Chinese"))
        {
            if (MySetLanguage.GetLanguage() == "ChineseSimplified")
                SetLanguage("Chinese");
            else
                SetLanguage("ChineseTraditional");
        }
        else
        {
            SetLanguage("English");
        }
    }

    public void  SetLanguage(string language)
    {
        setLanguage._Language = language;
        setLanguage.ApplyLanguage();
    }

    public static string GetLanguage()
    {
        //return Application.systemLanguage.ToString();
        //return "English";
        return "ChineseSimplified";
    }
}
